home *** CD-ROM | disk | FTP | other *** search
- procedure LoadList (ListView: TListView; DataSet: TDataSet; Fields: array of String);
- var
- Index: Integer;
- begin
- Screen.Cursor := crHourGlass;
- ListView.Items.BeginUpdate;
- try
- ListView.Items.Clear;
- DataSet.First;
- while not DataSet.EOF do begin
- with ListView.Items.Add do begin
- Caption := Fields[0];
- for Index := 1 to High (Fields) do begin
- SubItems.Add (DataSet.FieldByName (Index).AsString);
- end;
- end;
- DataSet.Next;
- end;
- finally
- Screen.Cursor := crDefault;
- ListView.Items.EndUpdate;
- end;
- end;
-
- LoadList (lvwOrders, OrderDataSet, ['Date', 'Price', 'Description']);
-